import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';

import '../../../design_specifications.dart';


///自定义container

class CustomContainer extends StatelessWidget {
  const CustomContainer({super.key, required this.child, this.title});
  final Widget child;
  final String? title;
  @override
  Widget build(BuildContext context) {
    return Container(
      decoration: BoxDecoration(
          color: Colors.white,
          borderRadius: BorderRadius.circular(8.w)
      ),
      padding: EdgeInsets.all(12.w),
      width: double.infinity,
      margin: EdgeInsets.symmetric(horizontal: 16.w),
      child: Column(
        children: [
          title==null?Container():Column(
            children: [
              Container(
                  alignment: Alignment.centerLeft,
                  child: Text(title!,style: TextStyle(fontSize: 14.sp,fontFamily: harmony,color: textColor),)),
              SizedBox(height: 12.w,),
            ],
          ),
          child
        ],
      ),
    );
  }
}
